﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace WindowsFormProject.Depo
{
    public partial class ParasalTextBox : TextBox 
    {
        public ParasalTextBox()
        {
            InitializeComponent();
            Setting();
        }

        public ParasalTextBox(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
            Setting();
        }
        void Setting()
        {

            this.BackColor = Color.White;
            this.Text = "0.00";
            this.TextAlign =  HorizontalAlignment.Right;
            this.KeyPress += new KeyPressEventHandler(ParasalTextBox_KeyPress);
        }

        void ParasalTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (char.IsDigit(e.KeyChar) == false && e.KeyChar != (char)08 && e.KeyChar != '.' && e.KeyChar != ',' && e.KeyChar != (char)127 && e.KeyChar != (char)44)
            {
                e.Handled = true;

            }
        }
    }
}
